﻿@using VirtualPress.Infrastructure.Entities.Entity;
@using VirtualPress.Tool.Framework;
@{
    Layout = null;
    Meeting meeting = ViewBag.Meeting;
    Article article = ViewBag.Article;
}
<!DOCTYPE html>
<html>
<head>
    <title>专审验收 -- @article.Title</title>
    <link rel="stylesheet" href="/content/css/evalutionform.css" />
    <link rel="stylesheet" href="/content/css/bootstrap.min.css" />
    <link rel="Stylesheet" href="/content/css/bootstrap-responsive.min.css" />
    <script type="text/javascript" src="/Scripts/jquery.js"></script>
    <script type="text/javascript" src="/Scripts/bootstrap.min.js"></script>
</head>
<body>
    @{
        List<AuditingRecord> records = ViewBag.Records;
        List<ArticleAuthor> authorList = ViewBag.Authors;
        string authors = string.Empty;
        for (int i = 0, len = authorList.Count; i < len; i++)
        {
            authors += authorList[i].AuthorName;
            if (i != len - 1)
            {
                authors += ", ";
            }
        }
    }
    <a href="/workspace/console/article?group=1">&lt;&lt;返回</a>
    <hr />
    <div class="container mini-layout">
        <div class="page-header center">
            <h3>
                稿件：@article.Title 专审验收</h3>
            <div class="left contentrow">
                <div>
                    <b>题目：</b>@article.Title</div>
                <div>
                    <b>编号：</b>@article.Code</div>
                <div>
                    <b>作者：</b>@authors</div>
            </div>
        </div>
        <div class="container">
            <form id="finishform" class="form-horizontal" action="/workspace/meeting/acceptanceexamine"
            method="post">
            <input type="hidden" name="articleId" id="hidarticleId" value="@article.Id" />
            <input type="hidden" name="sheetids" id="hidsheetids" />
            <div class="modal-body">
                <div class="widget-content">
                    <div class="control-group">
                        <label class="control-label">
                            验收结果</label>
                        <div class="controls">
                            <select id="sltres" name="result" onchange="changeexamineresult(this)">
                                <option value="0" selected="selected">进入终审</option>
                                <option value="1">要求专审修订</option>
                                <option value="2">重新分配专审</option>
                                <option value="9">专审不通过</option>
                            </select>
                        </div>
                    </div>
                    <div id="resmsgbox" style="display: none;">
                        <div class="control-group">
                            <label class="control-label">
                                参照审稿结果</label>
                            <div class="controls">
                                @if (records != null && records.Any())
                                {
                                    for (int i = 0, len = records.Count; i < len; i++)
                                    {
                                    <input type="checkbox" id="sheet@(i)" name="sheet" value="@records[i].Id" /><label for="sheet@(i)" style="display:inline; padding-left:10px;">@records[i].ExpertRealName
                                        审稿结果</label>
                                    }
                                }
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                附加意见</label>
                            <div class="controls">
                                <textarea id="tarmsg" name="msg" style="width: 600px; height: 180px;"></textarea>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <input type="submit" class="btn btn-primary" value="确定" />
                    <a data-dismiss="modal" class="btn" href="javascript:;">取消</a>
                </div>
            </form>
        </div>
        <div class="contentrow">
            <div class="widget-box">
                <div class="widget-title">
                    <ul class="nav nav-tabs">
                        @if (records != null && records.Any())
                        {
                            for (int i = 0, len = records.Count; i < len; i++)
                            {
                                if (i == 0)
                                {
                            <li class="active"><a data-toggle="tab" href="#tab@(i)">@records[i].ExpertRealName 审稿结果</a>
                            </li>
                                }
                                else
                                { 
                            <li><a data-toggle="tab" href="#tab@(i)">@records[i].ExpertRealName 审稿结果</a></li>
                                }
                            }
                        }
                    </ul>
                </div>
                <div class="widget-content tab-content">
                    @if (records != null && records.Any())
                    {
                        for (int i = 0, len = records.Count; i < len; i++)
                        {
                        <div id="tab@(i)" class="tab-pane @(i == 0 ? "active" : "")">
                            <div class="mini-layout">
                                <div class="contentrow">
                                    <div class="container-fluid">
                                        <div class="control-group container">
                                            <label class="control-label strong">
                                                1、稿件类型</label>
                                            <div class="controls">
                                                <div class="row-fluid">
                                                    <label class="radio">
                                                        <input type="radio" disabled="disabled" name="type@(i)" value="科研" />
                                                        科研
                                                    </label>
                                                    <label class="radio">
                                                        <input type="radio" disabled="disabled" name="type@(i)" value="实验" />
                                                        实验
                                                    </label>
                                                    <label class="radio">
                                                        <input type="radio" disabled="disabled" name="type@(i)" value="案例研究" />
                                                        案例研究
                                                    </label>
                                                    <label class="radio">
                                                        <input type="radio" disabled="disabled" name="type@(i)" value="调查" />
                                                        调查
                                                    </label>
                                                    <label class="radio">
                                                        <input type="radio" disabled="disabled" name="type@(i)" value="教程" />
                                                        教程
                                                    </label>
                                                    <label class="radio">
                                                        <input type="radio" disabled="disabled" name="type@(i)" value="其他" />
                                                        其他
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                        <hr />
                                        <div class="control-group container">
                                            <label class="control-label strong">
                                                2、总体评价</label>
                                            <div class="controls">
                                                <div class="control-group">
                                                    <label class="control-label">
                                                        1) 原创性</label>
                                                    <div class="controls">
                                                        <label class="radio">
                                                            <input type="radio" disabled="disabled" name="Originality@(i)" value="优秀" />
                                                            优秀
                                                        </label>
                                                        <label class="radio">
                                                            <input type="radio" disabled="disabled" name="Originality@(i)" value="好" />
                                                            好
                                                        </label>
                                                        <label class="radio">
                                                            <input type="radio" disabled="disabled" name="Originality@(i)" value="一般" />
                                                            一般
                                                        </label>
                                                        <label class="radio">
                                                            <input type="radio" disabled="disabled" name="Originality@(i)" value="差" />
                                                            差
                                                        </label>
                                                        <label class="radio">
                                                            <input type="radio" disabled="disabled" name="Originality@(i)" value="很差" />
                                                            很差
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="control-group container">
                                            <label class="control-label">
                                                2) 实用性</label>
                                            <div class="controls">
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="Usefulness@(i)" value="优秀" />
                                                    优秀
                                                </label>
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="Usefulness@(i)" value="好" />
                                                    好
                                                </label>
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="Usefulness@(i)" value="一般" />
                                                    一般
                                                </label>
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="Usefulness@(i)" value="差" />
                                                    差
                                                </label>
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="Usefulness@(i)" value="很差" />
                                                    很差
                                                </label>
                                            </div>
                                        </div>
                                        <div class="control-group container">
                                            <label class="control-label">
                                                3) 技术合理性</label>
                                            <div class="controls">
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="Soundness@(i)" value="优秀" />
                                                    优秀
                                                </label>
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="Soundness@(i)" value="好" />
                                                    好
                                                </label>
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="Soundness@(i)" value="一般" />
                                                    一般
                                                </label>
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="Soundness@(i)" value="差" />
                                                    差
                                                </label>
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="Soundness@(i)" value="很差" />
                                                    很差
                                                </label>
                                            </div>
                                        </div>
                                        <div class="control-group container">
                                            <label class="control-label">
                                                4) 语言描述</label>
                                            <div class="controls">
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="LinguisticQuality@(i)" value="优秀" />
                                                    优秀
                                                </label>
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="LinguisticQuality@(i)" value="好" />
                                                    好
                                                </label>
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="LinguisticQuality@(i)" value="一般" />
                                                    一般
                                                </label>
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="LinguisticQuality@(i)" value="差" />
                                                    差
                                                </label>
                                                <label class="radio">
                                                    <input type="radio" disabled="disabled" name="LinguisticQuality@(i)" value="很差" />
                                                    很差
                                                </label>
                                            </div>
                                        </div>
                                        <hr />
                                        <div class="control-group">
                                            <label class="control-label strong">
                                                3、稿件说明</label>
                                            <div class="controls">
                                                <div class="control-group">
                                                    <label class="control-label">
                                                        1) 稿件解决了什么问题？</label>
                                                    <div class="controls">
                                                        <p>@records[i].Resolution</p>
                                                    </div>
                                                </div>
                                                <div class="control-group">
                                                    <label class="control-label">
                                                        2) 主要领域作出的贡献？</label>
                                                    <div class="controls">
                                                        <p>@records[i].Contribution</p>
                                                    </div>
                                                </div>
                                                <div class="control-group">
                                                    <label class="control-label">
                                                        3) 在哪些方面确实缺乏原创？</label>
                                                    <div class="controls">
                                                        <p>@records[i].Originalless</p>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <hr />
                                        <div class="control-group">
                                            <label class="control-label strong">
                                                4、最终审评</label>
                                            <div class="controls">
                                                <label class="checkbox">
                                                    <input type="radio" disabled="disabled" name="verdict@(i)" value="0" />
                                                    推荐接收
                                                </label>
                                                <label class="checkbox">
                                                    <input type="radio" disabled="disabled" name="verdict@(i)" value="1" />
                                                    接收
                                                </label>
                                                <label class="checkbox">
                                                    <input type="radio" disabled="disabled" name="verdict@(i)" value="2" />
                                                    需较小修订
                                                </label>
                                                <label class="checkbox">
                                                    <input type="radio" disabled="disabled" name="verdict@(i)" value="3" />
                                                    需较大修订
                                                </label>
                                                <label class="checkbox">
                                                    <input type="radio" disabled="disabled" name="verdict@(i)" value="9" />
                                                    拒绝
                                                </label>
                                            </div>
                                            <div class="control-group">
                                                <label class="control-label">
                                                </label>
                                                <div class="controls">
                                                    <p>@records[i].Suggestion</p>
                                                </div>
                                            </div>
                                        </div>
                                        <hr />
                                        <div class="control-group">
                                            <div class="controls">
                                                @if (records[i].AppendixId > 0)
                                                {
                                                    Appendix att = new Appendix().Find(records[i].AppendixId.ToString());
                                                    <ul>
                                                        <li><a target="_blank" title="点击下载" href="/download?token=@EncodeByBase64.Encode(new { id = att.Id, type = 9 }.ToJson())">
                                                            <i class="icon-file icon-large"></i>
                                                            包含附件： @att.FileName;</a> <span style="color: #999; font-style: italic; padding-left: 25px;">@att.CreateTime.ToString("yyyy-MM-dd")</span>
                                                        </li>
                                                    </ul>
                                                }
                                                else
                                                {
                                                    <p>
                                                        不包含附件</p>
                                                }
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <script type="text/javascript">
                            $(function () {
                                $('input:radio[name="type@(i)"][value="@records[i].ManuscriptType"]').attr('checked', 'checked');
                                $('input:radio[name="Originality@(i)"][value="@records[i].Originality"]').attr('checked', 'checked');
                                $('input:radio[name="Usefulness@(i)"][value="@records[i].Usefulness"]').attr('checked', 'checked');
                                $('input:radio[name="Soundness@(i)"][value="@records[i].Soundness"]').attr('checked', 'checked');
                                $('input:radio[name="LinguisticQuality@(i)"][value="@records[i].LinguisticQuality"]').attr('checked', 'checked');
                                $('input:radio[name="verdict@(i)"][value="@((int)records[i].SuggestStatus)"]').attr('checked', 'checked');
                            });
                        </script>
                        }
                    }
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        function changeexamineresult(sender) {
            if ($(sender).val() == 0 || $(sender).val() == 2) {
                $('#resmsgbox').hide();
            }
            else {
                $('#resmsgbox').show();
            }
        }
        $(function () {
            $('#finishform').submit(function () {
                var msg = $('#tarmsg').val();
                var res = $('#sltres').val();
                if (res == '1' || res == '9') {
                    if (msg == '') {
                        alert('请填写附件意见');
                        return false;
                    }
                }
                var ids = '';
                $('input:checkbox[name="sheet"][checked]').each(function () {
                    ids += $(this).val() + ";";
                });
                $('#hidsheetids').val(ids);
            });
        });
    </script>
</body>
</html>
